package sgg.algorithm.datastructure.search;

/**
 * @author: Michael
 * @date: 2025/4/30
 * @desc: 普通查找 - 顺序查找
 */
public class NormalSearch {

    public static void main(String[] args) {
        int[] arr = {1, 9, 11, -1, 34, 89};
        System.out.println(search(arr, 89));
    }

    public static int search(int[] arr, int value) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == value) {
                return i;
            }
        }
        return -1;
    }
}
